/**
 * Copyright (C) 2017-2018 pinganfang, Inc. All Rights Reserved.
 */
package com.pingan.haofang.searchcloud.api.route;

import java.util.ServiceLoader;

/**
 * @author huhailiang937
 * @date 2017年7月6日上午11:21:33
 * @since 1.0.0
 */
public class IndexRouteRegisterFactory {

    
    private static IndexRouteRegister register;

    public static IndexRouteRegister get() {
        if (null != register) {
            return register;
        }
        ServiceLoader<IndexRouteRegister> registers = ServiceLoader.load(IndexRouteRegister.class);
        for (IndexRouteRegister holder : registers) {
            register = holder;
        }
        return register;
    }
}
